import servers from '@/utils/servers'

// 获取文章详情
export const getArticleDetails = articleId => {
  return servers({
    url: `/v1_0/articles/${articleId}`
  })
}
// 关注用户
export const addfollowing = target => {
  return servers({
    url: '/v1_0/user/followings',
    method: 'POST',
    data: {
      target
    }
  })
}
// 取消关注
export const removefollowing = target => {
  return servers({
    url: `/v1_0/user/followings/${target}`,
    method: 'DELETE'
  })
}
// 收藏文章
export const collectArticle = data => {
  return servers({
    url: '/v1_0/article/collections',
    method: 'POST',
    data
  })
}
// 取消收藏文章
export const removecollectArticle = target => {
  return servers({
    url: `/v1_0/article/collections/${target}`,
    method: 'DELETE'
  })
}
// 点赞文章
export const goodArticle = data => {
  return servers({
    url: '/v1_0/article/likings',
    method: 'POST',
    data
  })
}
// 取消点赞文章
export const removegoodArticle = target => {
  return servers({
    url: `/v1_0/article/likings/${target}`,
    method: 'DELETE'
  })
}
